package com.example.freeengine.wallpaper.fragment.cyclerefresh;

import com.example.freeengine.wallpaper.persistence.entity.WallPaperCycleRefreshAlbum;
import com.google.common.base.Objects;

/**
 * @author Terry Deng
 */
public class AlbumInfo {

    Long albumId;
    int itemCount;
    String previewPath;
    boolean isUsing;
    String name;

    WallPaperCycleRefreshAlbum wallPaperCycleRefreshAlbum;

    public AlbumInfo() {
    }

    public AlbumInfo(WallPaperCycleRefreshAlbum wallPaperCycleRefreshAlbum) {
        this.wallPaperCycleRefreshAlbum = wallPaperCycleRefreshAlbum;
        this.albumId = wallPaperCycleRefreshAlbum.getId();
    }

    public AlbumInfo(WallPaperCycleRefreshAlbum wallPaperCycleRefreshAlbum, boolean using) {
        this.wallPaperCycleRefreshAlbum = wallPaperCycleRefreshAlbum;
        this.albumId = wallPaperCycleRefreshAlbum.getId();
        this.isUsing = using;
    }

    public Long getAlbumId() {
        return albumId;
    }

    public void setAlbumId(Long albumId) {
        this.albumId = albumId;
    }

    public int getItemCount() {
        return itemCount;
    }

    public void setItemCount(int itemCount) {
        this.itemCount = itemCount;
    }

    public String getPreviewPath() {
        return previewPath;
    }

    public void setPreviewPath(String previewPath) {
        this.previewPath = previewPath;
    }

    public boolean isUsing() {
        return isUsing;
    }

    public void setUsing(boolean using) {
        isUsing = using;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public WallPaperCycleRefreshAlbum getWallPaperCycleRefreshAlbum() {
        return wallPaperCycleRefreshAlbum;
    }

    public void setWallPaperCycleRefreshAlbum(WallPaperCycleRefreshAlbum wallPaperCycleRefreshAlbum) {
        this.wallPaperCycleRefreshAlbum = wallPaperCycleRefreshAlbum;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AlbumInfo albumInfo = (AlbumInfo) o;
        return itemCount == albumInfo.itemCount && isUsing == albumInfo.isUsing && Objects.equal(albumId, albumInfo.albumId) && Objects.equal(previewPath, albumInfo.previewPath) && Objects.equal(name, albumInfo.name);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(albumId, itemCount, previewPath, isUsing, name);
    }
}
